<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * location.php
 * @author ranuandra
 *
 * 14 Agu 2011 22:51:56
 *
 * 
 */

class Model_Location extends ORM
{
   protected $_has_many = array(
								'materialin' 	=> array('model' => 'materialin'),
   								'stock'			=> array('model' => 'stock'),
							);
	
	private $_form = array('name' 		=> '',
							);
							
	private $_field = array(
						'name',
					);

	public function rules()
	{
		return array(
			'name' 	   => array(
			 						array('min_length', array(':value', 0)),
			 ),

		);
	}
	
	public function get_form()
	{
		return $this->_form;
	}
	
	public function get_field()
	{
		return $this->_field;
	}
	
	public function create_location($values)
	{
		return $this->values($values, $this->_field)->create();
	}
}